Random = Mock.Random

function getMyInfo(){
    let data = Mock.mock({
        'username' : Random.cname(),
        'avatar' : Random.image()
    })

    let json  ={
        data,
        code : 200,
        msg : '获取成功'
    }

    return json
}

function changePwd(){
    return {
        'code' : 200,
        'msg' : '密码修改成功'
    }
}

Mock.mock('http://locahost/get_admin.php', 'get', getMyInfo)

Mock.mock('http://locahost/admin/change_pwd.php', 'post', changePwd)